<?php
class ShowLink extends Action {
	/* (non-PHPdoc)
	 * @see Action::execute()
	 */
	public function execute($params) {
		check_login ( ADMIN_LOGIN_PAGE );
		$lids = rqst ( 'lid' );
		$display = irqst ( 'd', 1 );
		if (! empty ( $lids )) {
			$lids = safe_ids ( $lids, ",", true );
			$lkM = new WebLinkModel ();
			$rst = $lkM->update ( array ('display' => $display ), array ('link_id IN' => $lids ) );
			if ($rst === false) {
				sess_add ( 'page_tip_info', '设置友情链接的可见性出错：' . $lkM->last_error_msg () );
			}
		} else {
			sess_add ( 'page_tip_info', '未指定要设置可见性的友情链接.' );
		}
		Response::redirect ( $this->referer );
	}
}